﻿<%@ page language="java" contentType="text/html; charset=UTF-8"pageEncoding="UTF-8"%>
<%@ taglib uri="http://struts.apache.org/tags-html" prefix="html"%>
<%@ page import="javax.servlet.http.HttpSession"%>
<%@ taglib uri="http://struts.apache.org/tags-logic" prefix="logic"%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html:html>
<head>

<title>Mathematic Dictionary</title>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge" />
<meta http-equiv="pragma" content="no-cache">
<meta http-equiv="cache-control" content="no-cache">
<meta http-equiv="expires" content="0">
<meta http-equiv="keywords" content="keyword1,keyword2,keyword3">
<meta http-equiv="description" content="This is my page">

<title>Tra từ điển toán học Online | Từ điển toán học đa ngôn ngữ | tra tu dien toan online</title>
<meta name="description"
	content="Từ điển toán học online, từ điển toán học đa ngôn ngữ online, tra tu điển toán online"></meta>
<meta name="keywords"
	content="Từ điển toán, tu dien toan, từ điển toán học online, math dictionary, tra tu dien toan online"></meta>
<meta name="robots" content="index, follow" />
<meta name="geo.region" content="VN" />

<script type="text/javascript" charset="utf-8" src="script/jquery-1.9.1.js"></script>
<script type="text/javascript" charset="utf-8" src="script/blogScript.js"></script>
<script type="text/javascript" charset="utf-8" src="script/script.js"></script>
<script type="text/javascript" charset="utf-8" src="script/paging.js"></script>

<link rel="stylesheet" type="text/css" href="./css/mycss.css" />
<link rel="stylesheet" type="text/css" media="screen"
	href="./css/jquery.css"></link>
<link rel="stylesheet" type="text/css" media="screen"
	href="./css/screen01.css"></link>
<link rel="stylesheet" type="text/css" media="screen"
	href="./css/facebox.css"></link>
<link rel="stylesheet" type="text/css" media="screen"
	href="./css/tooltipster.css"></link>
<link rel="stylesheet" type="text/css" media="screen"
	href="./css/tooltipster-clean-cut.css"></link>
<link rel="stylesheet" type="text/css" media="screen"
	href="./css/jquery_002.css"></link>
	
<script type="text/javascript" src="script/jquery.min.js"></script>
<script type="text/javascript" src="script/prepare.js"></script>
<script type="text/javascript" src="script/functions.js"></script>
<script type="text/javascript" src="script/jquery.tooltipster.js"></script>
<script type="text/javascript" src="script/jquery.alerts.js"></script>
<script type="text/javascript" src="script/jquery.anythingslider.js"></script>
</head>

<body>
	<div id="wrapper" class="hfeed">
		<div id="header">
			<div id="masthead">
				<div>
					<a ><html:link action="/home"><img border="0"
						src="./img/logoMathDict.png" 
						title="Từ điển toán học đa ngôn ngữ online" />
						</html:link>
						</a>

					<div id="site-description">Tra từ điển toán học trực tuyến</div>

				</div>
				<!-- #branding -->


				<div id="access">
					<div class="menu-header">
						<ul id="menu-main" class="menu">
							<li id="menu-item-6"
								class="menu-item menu-item-type-custom menu-item-object-custom menu-item-6">
								<a title="Giới thiệu về trang web"> <html:link action="/Home">Trang chủ</html:link>
								</a></li>
							<li id="menu-item-5"
								class="menu-item menu-item-type-custom menu-item-object-custom menu-item-5"><a
								title="Tra từ điển toán Online"> <html:link action="/SearchForm">Tra từ điển toán Online</html:link>
								</a></li>
							<li id="menu-item-10"
								class="menu-item menu-item-type-custom menu-item-object-custom current-menu-item current_page_item menu-item-home menu-item-10"><a
								title="Tham gia thảo luận, góp ý" href="http://localhost:8080/MathDict/blog.do">Thảo luận</a></li>
						</ul>
						<%
							String userName = (String) session.getAttribute("userName");
								if ((userName == "") || userName == null) {
						%>
							<div id = "boxLogin" class="boxLogin">
								<input title="Tên đăng nhập"
									style="width: 90px; padding: 1px" name="userName" type="text" id = "userName"/>
									<input title="Mật khẩu" style="width: 90px; padding: 1px"
									name="password" type="password" id = "password"/>
								
								<html:submit property="login" value="Đăng nhập"
										style="font-size: 13px; width: 80px;padding: 1px" onclick = "logIn();"></html:submit>
								
								<html:submit property="registry" value="Đăng ký" onclick="location.href='http://localhost:8080/MathDict/Registration.jsp'; "
										style="font-size: 13px; width: 80px;padding: 1px;">
										<a href = "http://localhost:8080/MathDict/Registration.do"></a>
								</html:submit>
							</div>
							
							<div id = "boxWelcome" style = "display: none;" class = "welcome">
								<p>Xin chào: <span id = "welcomeName"></span>
								&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<i><label style="color: red;" onclick = "logOut1();">Thoát</label></i></p>
							</div>
						<%
							} else {
						%>
							<div id = "boxWelcome2" class = "welcome" style = "display:'';">
								<p>Xin chào: <%=userName%> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<i><label style="color: red;" onclick = "logOut2();">Thoát</label></i></p>
								
							</div>
							<div id = "boxLogin" class="boxLogin" style = "display: none;">
								<input title="Tên đăng nhập"
									style="width: 100px; padding: 1px" name="userName" type="text" id = "userName"/>
									<input title="Mật khẩu" style="width: 100px; padding: 1px"
									name="password" type="password" id = "password"/>
								
								<html:submit property="login" value="Đăng nhập"
										style="font-size: 12.5px; width: 75px;padding: 1px" onclick = "logIn();"></html:submit>
								
								<html:submit property="registry" value="Đăng ký" onclick="location.href='http://localhost:8080/MathDict/Registration.jsp'; "
										style="font-size: 12.5px; width: 70px;padding: 1px;">
										<a href = "http://localhost:8080/MathDict/Registration.jsp"></a>
								</html:submit>
							</div>
							<div id = "boxWelcome" style = "display: none;" class = "welcome">
								<p>Xin chào: <span id = "welcomeName"></span>
								&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<i><label style="color: red;" onclick = "logOut1();">Thoát</label></i></p>
							</div>
						<%
							}
						%>
					</div>
				</div>
				<!-- #access -->
			</div>
			<!-- #masthead -->
		</div>
		<!-- #header -->

		<div id="main">
			<!-- #content -->
			<div id="dgn_center">
				<div class="ltbox">
					<div class="ctr_hd">
						<span class="ctr_today">Thảo luận nhanh</span>
					</div>
					<div id="dgn_comment">
							<html:form action="/blog">
							<div class="cmentrow">
								<%
									if ("NOK".equals(request.getAttribute("NOK"))) {
								%>
									<script type="text/javascript">
									jAlert("Bạn cần đăng nhập để tham gia thảo luận!");
									</script>
								<%
									} else if ("NOK1".equals(request.getAttribute("NOK1"))) {
								%>
									<script type="text/javascript">
									jAlert("Bạn chưa nhập nội dung thảo luận");
									</script>
								<%
									}
								%>
									<div class="cmentbox" >
										<textarea name="content" id="content">Hãy chia sẽ ý kiến của bạn...</textarea>
									</div>
									<div class="cmentcor"></div>
									<input name="Submit" value="Gửi thảo luận" class="combtn" type="submit"/> 
								
							</div>
							</html:form>
							<div id="commented">
								<table cellpadding="0" cellspacing="0" border="0"
									class="sortable" id="sorter">
								<logic:iterate id="listChat" name="blogForm" property="listChat">
									<html:form action="/deleteChat">
										<tr>
											<td style="text-align: left;">
												<div class="cmentrow">
													<div class="userimg">
														<img src="img/avatar.png" width="32">
													</div>
													<div class="usercom">
														<div class="username">
															<span style="color: #FB940B">${listChat.userName}</span>
															<span class="usertime">${listChat.time}</span>
														</div>
														${listChat.comment}

													</div>
													<div></div>
												</div>
											</td>
											<td style="text-align: right;">
												<div style="display: '';">
												</div> <html:hidden property="chatId" value="${listChat.chatId}" />
												<%
													if (("1".equals(session.getAttribute("groupId")))) {
												%> <html:submit
													property="delete" value="Xóa"
													style="font-size: 12.5px; width: 50px;"
													onclick="DeleteChat('${listChat.chatId}');"></html:submit> 
												<%
												 	}
												%>
											</td>
										</tr>
									</html:form>
								</logic:iterate>

							</table>
								<div id="pageNavPosition"></div>
								<script type="text/javascript">
									var sorter = new table.sorter("sorter");
									sorter.init("sorter", 0);
								</script>
								<script type="text/javascript">
									var pager = new Pager('sorter', 10);
									pager.init();
									pager.showPageNav('pager',
											'pageNavPosition');
									pager.showPage(1);
								</script>

							</div>
							
						</div>
					<!-- dgn_comment -->
				</div>
				<!-- ltbox -->
				<br>
				<br>
			</div>
			<!-- dgn_center -->
		</div>
		<!-- main -->
		
		<%--Phần nội dung footer --%>

		<div id="footer" >
			<div id="colophon">
				<div id="site-info">
					<a  title="Trang giới thiệu" rel="Home"> <html:link action="/Home">Từ điển toán học online | Mathematic dictionary Multilanguage</html:link> </a>
					<br />
				</div>
				<!-- #site-info -->

			</div>
			<!-- #colophon -->
		</div>
		<!-- #footer -->
	</div>
	<!-- wrapper -->
		<br>
</body>
</html:html>
